package com.bawei.lookfor2204a.view.activity.realname

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.bawei.lookfor2204a.model.HttpUtils
import com.bawei.lookfor2204a.model.RealNameAuthenticationBean
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import retrofit2.http.Query

/**
 * 作者：赵亮
 * 时间：2024/10/23 16:18
 * 功能：实名认证View Model
 */
class RealNameViewModel : ViewModel() {

    // 实名认证
    val realNameAuthenticationSuccess = MutableLiveData<RealNameAuthenticationBean>()
    fun realNameAuthentication(
        actualName: String,
        sex: Int,
        birthday: String,
        address: String,
        idNumber: String,
        office: String,
        expireDate: String,
    ) {
        HttpUtils.HttpUtils.apiService.realNameAuthentication(actualName, sex, birthday, address, idNumber, office, expireDate)
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe { realNameAuthenticationSuccess.postValue(it) }
    }
}